import store from '@/store';
import {removeResources} from '@/utils/menuResource';
import {removeUserInfo} from '@/utils/user';

export const getToken = ()=> store.getters['user/getToken'];
export const setToken = async(token) => {
  try{
    await store.dispatch('user/setToken',token);
    return true;
  }catch(e){
    return false;
  }
}
export const removeToken = () => {
  setToken('');
  removeResources();
  removeUserInfo();
}
